local jichou = fk.CreateSkill{
  name = "hanqing__jichou",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["hanqing__jichou"] = "激雠",
  [":hanqing__jichou"] = "锁定技，你前置位受到你或“托谋”角色伤害+1；你使用的锦囊牌对你后置位效果改为与其各摸一张牌。",
}

jichou:addEffect(fk.DamageInflicted, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(jichou.name) and target.seat < player.seat and
      data.from and (data.from == player or data.from.id == player:getMark("hanqing__tuomou-round"))
  end,
  on_use = function (self, event, target, player, data)
    data:changeDamage(1)
  end,
})

jichou:addEffect(fk.CardUsing, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(jichou.name) and
      data.card.sub_type == Card.SubtypeDelayedTrick and
      table.find(data.tos, function (p)
        return p.seat > player.seat
      end)
  end,
  on_use = function (self, event, target, player, data)
    local to = data.tos[1]
    data.nullifiedTargets = data.nullifiedTargets or {}
    table.insertIfNeed(data.nullifiedTargets, to)
    player:drawCards(1, jichou.name)
    if not to.dead then
      to:drawCards(1, jichou.name)
    end
  end,
})

jichou:addEffect(fk.PreCardEffect, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return data.from == player and player:hasSkill(jichou.name) and
      data.card:isCommonTrick() and data.to and data.to.seat > player.seat
  end,
  on_use = function (self, event, target, player, data)
    data:changeCardSkill("hanqing__jichou__cardskill")
  end,
})

return jichou
